<?php

namespace app\index\controller\source;

use app\index\model\UM as UM;
use app\index\service\SourceRecordingService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;
use think\Request as Request;

/**
 *
 * Class SourceRecording
 * @package app\index\controller\source
 */
class SourceRecording
{
    // 请求参数
    private Request $request;
    private SourceRecordingService $service;

    public function __construct(Request $request, SourceRecordingService $sourceRecordingService)
    {
        $this->request = $request;
        $this->service = $sourceRecordingService;
    }

    /**
     * 案如云-录音列表
     * @param UM $user
     * @return ApiResponse
     * @url /source/source_recording/index
     */
    public function index(UM $user): ApiResponse
    {
        $request = $this->request;

        return ApiResponse::success($this->service->index($user, $request->param()));
    }

}
